package com.coupons.business.common.vo.decorator;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.coupons.business.common.vo.MerchantOffer;

public class MerchantOffersRowMapper implements RowMapper {

	public Object mapRow(ResultSet ar, int index) throws SQLException {
		
		MerchantOffer objlMerchantOffers = new MerchantOffer();
		
		objlMerchantOffers.setOfferId(ar.getInt("offer_id"));
		objlMerchantOffers.setMerchantMoreOffersText(ar.getString("offer_more_txt"));
		objlMerchantOffers.setOfferMessage(ar.getString("offer_msg"));
		objlMerchantOffers.setExpiryDate(ar.getDate("expiry_date"));
		objlMerchantOffers.setCouponCode(ar.getString("coupon_code"));
		objlMerchantOffers.setCategoryId(ar.getInt("ctgry_id"));
		objlMerchantOffers.setHomePageOffer(ar.getString("home_pg_offer"));
		objlMerchantOffers.setHomePageOfferIndex(ar.getInt("home_pg_oofer_index"));
		objlMerchantOffers.setSpecialOffer(ar.getString("special_oofer"));
		objlMerchantOffers.setSpecialOfferIndex(ar.getInt("special_offer_ndex"));
		objlMerchantOffers.setOfferRedirectURL(ar.getString("offer_redirect_url"));
		objlMerchantOffers.setMerchantPageOfferIndex(ar.getInt("offer_index"));
		objlMerchantOffers.setCreationDate(ar.getDate("crtn_dt"));
		objlMerchantOffers.setLastUpdatedDate(ar.getDate("last_updt_dt"));
		objlMerchantOffers.setLastUpdatedUser(ar.getString("last_updt_user")); 
		objlMerchantOffers.setMerchantId(ar.getInt("mrchnt_id"));
		objlMerchantOffers.setPartnerId(ar.getInt("partner_id"));
		objlMerchantOffers.setMerchantEmblem(ar.getString("merchantEmblem"));
		
		
		return objlMerchantOffers;
	}

}
